@import url("../../[branding]_components/dealerInteractiveMap.css");

.dealer-map__map-container {
  align-self: stretch;
  height: auto;
  max-height: 100vh;
}

.dealer-map__search {
  order: 2;
  border: 1px solid #E6E6E6;
}

.dealer-map__search-input,
.dealer-map__search-icon {
  height: auto;
  align-self: stretch;
  border: none;
}

.dealer-map__search-input::placeholder {
  color: #BBBBBB;
}

.dealer-map__km-row {
  order: 1;
}

.dealer-map__tabs {
  width: 735px;
  margin-top: 20px;
}

.dealer-map__tabs__border {
  display: flex;
  width: 100%;
}

.dealer-map__tab {
  flex: 1;
  min-height: 44px;
  height: auto;
  padding-top: 10px;
}

/* BYD panel-inner — centered content with white background */
.dealer-map__panel-inner {
  align-items: center;
  background-color: #FFFFFF;
}

/* BYD active tab — brand font */
.dealer-map__tab {
  font-family: var(--font-family-1);
  font-weight: var(--weight-normal);
  color: var(--gray-dark-6);
}
.dealer-map__tab.is-active {
  font-family: var(--font-family-2);
  font-weight: var(--weight-bolder);
}

/* BYD controls — centered layout */
.dealer-map__controls {
  justify-content: center;
  align-items: center;
  width: 735px;
  margin: 0 auto;
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 0;
}

/* BYD helper — right-aligned */
.dealer-map__helper {
  text-align: center;
}

/* BYD km-row — inline km/select layout */
.dealer-map__km-row {
  display: flex;
  flex-direction: row;
  gap: 10px;
}

/* BYD search — fixed width instead of flex:1 */
.dealer-map__search {
  flex: unset;
  width: 298px;
  height: 45px;
}

/* BYD hours-detail — margin-left only */
.dealer-map-card__hours-detail {
  margin-left: var(--dim-hours-detail-margin);
}

/* BYD dealer card — centered with full width */
.dealer-map-card {
  margin: 0 auto;
  position: relative;
  width: 100%;
  border-bottom: none;
}

.dealer-map-card::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  border-bottom: var(--dim-card-border-bottom);
}

/* BYD outline CTA hover — brand-black border */
.dealer-map-card__cta--outline:hover {
  border: 2px solid #4D4D4D;
  background-color: transparent;
}

.dealer-map-card__cta--outline {
  border: 1px solid #4D4D4D;
  color: #4D4D4D;
}

.dealer-map__toolbar {
  background: var(--brand-white);
  border-bottom: none;
}

.dealer-map__select {
  border: none !important;
  border-bottom: none !important;
  outline: none;
}

.dealer-map__select:focus {
  border: none !important;
  border-bottom: none !important;
  outline: none;
}

.dealer-map__helper {
  margin-top: 0;
  padding-top: var(--dim-helper-margin-top);
  border-top: 1px solid var(--gray-dark-11);
}

.dealer-map__search-clear {
  display: none;
}

.dealer-map-card__title {
  margin-left: 54px;
}

.dealer-map__control-group {
  height: 70px;
}

@media (min-width: 1025px) {
  .dealer-map__layout {
    align-items: stretch;
  }

  .dealer-map__map-container {
    align-self: stretch;
    height: auto;
  }

  .dealer-map__controls {
    justify-content: center;
    align-items: flex-start;
  }

  .dealer-map__panel-inner {
    max-width: 100%;
  }

  .dealer-map__list {
    width: 100%;
    max-width: 100%;
  }

  .dealer-map-card {
    padding-left: max(40px, calc((100% - 720px) / 2));
    padding-right: max(40px, calc((100% - 720px) / 2));
  }
}

@media (max-width: 1366px) {
  .dealer-map__tabs,
  .dealer-map__controls {
    width: 585px;
  }

  .dealer-map-card__cta {
    min-width: 193px;
    height: 60px;
  }
}

/* BYD — font-size reductions at tablet */
@media (max-width: 1024px) {
  .dealer-map__panel {
    padding: 0 82px;
  }

  .dealer-map__controls {
    flex-direction: column;
  }

  .dealer-map__tabs,
  .dealer-map__controls {
    width: 100%;
  }

  .dealer-map__km-row,
  .dealer-map__search {
    width: 100%;
    align-self: stretch;
  }

  .dealer-map__control-group {
    flex: 1;
    width: 100%;
  }

  .dealer-map__select {
    width: 100%;
  }

  .dealer-map__panel-inner {
    max-width: 100%;
    align-items: stretch;
  }

  .dealer-map__tabs__border {
    margin-left: -82px;
    margin-right: -82px;
  }

  .dealer-map-card {
    padding-left: 0;
    padding-right: 0;
  }

  .dealer-map__tab {
    text-align: center;
    height: 44px;
    min-height: 44px;
    padding-top: 0;
    padding-bottom: 0;
    align-items: center;
  }

  .dealer-map-card__title {
    font-size: 22px;
    margin-left: 0;
    text-align: center;
  }

  .dealer-map-card__address,
  .dealer-map-card__phone,
  .dealer-map-card__email {
    font-size: var(--text-base);
  }

  .dealer-map-card__hours-row {
    font-size: var(--text-base);
  }

  .dealer-map-card__cta {
    font-size: var(--text-base);
  }
}

/* BYD — 900px breakpoint */
@media (max-width: 900px) {
  .dealer-map__map-container {
    height: 460px;
  }

  .dealer-map__control-group {
    min-width: auto;
    flex: 1;
  }

  .dealer-map-card__footer {
    flex-direction: column;
    gap: 18px;
  }

  .dealer-map__select {
    width: 100%;
    min-width: 0;
  }

  .dealer-map-card__icon {
    width: auto;
    height: auto;
  }

  .dealer-map-card__cta {
    width: 475px;
    margin: 0 auto;
    height: 45px;
  }

  .dealer-map__panel {
    background: var(--brand-white);
  }
}

@media (max-width: 768px) {
  .dealer-map-card__cta {
    min-width: 475px;
    height: 48px;
  }
}

/* BYD mobile — brand-specific map height, font-sizes, card padding, and cascade resets */
@media (max-width: 576px) {
  .dealer-map__map-container {
    height: 372px !important;
  }

  .dealer-map-card__title {
    font-size: 16px;
  }

  .dealer-map-card__address,
  .dealer-map-card__phone,
  .dealer-map-card__email {
    font-size: var(--text-sm);
  }

  .dealer-map-card__hours-row {
    font-size: var(--text-sm);
  }

  .dealer-map-card {
    padding: 20px 20px;
  }

  .dealer-map-card__footer {
    gap: 10px;
  }

  .dealer-map-card__cta {
    width: 100%;
    max-width: 266px;
    margin: 0 auto;
  }

  .dealer-map__search,
  .dealer-map__select,
  .dealer-map__km-row {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 576px) {
  .dealer-map__panel {
    padding: 0;
  }

  .dealer-map__tabs__border {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .dealer-map__tabs,
  .dealer-map__controls {
    width: 100%;
  }

  .dealer-map__panel-inner {
    align-items: stretch;
  }

  .dealer-map__tab {
    text-align: center;
  }

  .dealer-map-card__title {
    text-align: center;
  }
}

@media (max-width: 360px) {
  .dealer-map-card__cta {
    min-width: 266px;
    height: 48px;
  }
}
